package cn.quevo.ucenter.server.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.quevo.core.exception.CustomException;
import cn.quevo.ucenter.server.dao.OauthClientDao;
import cn.quevo.ucenter.server.entity.OauthClient;
import cn.quevo.ucenter.server.entity.query.OauthClientQuery;
import cn.quevo.ucenter.server.service.OauthClientService;

@Service("oauthClientService")
@Transactional(transactionManager="transactionManager",rollbackFor={Exception.class})
public class OauthClientServiceImpl implements OauthClientService {

    @Resource(name = "oauthClientDao")
    private OauthClientDao oauthClientDao;
    @Override
    public Integer createOauthClient(OauthClient oauthClient) throws CustomException {
        return this.oauthClientDao.create(oauthClient);
    }

    @Override
    public Integer updateOauthClient(OauthClient oauthClient) throws CustomException {
        return this.oauthClientDao.update(oauthClient);
    }

    @Override
    public OauthClient getOauthClient(OauthClientQuery oauthClientQuery) throws CustomException {
        return this.oauthClientDao.getSinge(oauthClientQuery);
    }

}
